import sys

from PySide2.QtWidgets import QDialog, QVBoxLayout, QPushButton, QHBoxLayout, QMessageBox, QMainWindow, QWidget, QApplication
# from params_model.fuselage_web.dlg_fuselage_web import DlgFuselageWeb
from .material_library.material_library import DlgMaterialLibrary
from .stringed_bar_library.stringed_bar_library import DlgStringedBarLibrary
from .lumped_mass.lumped_mass import DlgLumpedMass



class MainWindow(QMainWindow):
    def __init__(self,parent=None):
        super().__init__(parent)
        self.number = 0
 
        w = QWidget()
        self.setCentralWidget(w)
        
        self.MapButton = QPushButton(self)
        self.MapButton.setText("测试1")
        self.MapButton.setAutoFillBackground(False)
        self.MapButton.clicked.connect(self.test)
        
        self.MapButton2 = QPushButton(self)
        self.MapButton2.setText("测试2")
        self.MapButton2.setAutoFillBackground(False)
        self.MapButton2.clicked.connect(self.test2)
        
        self.MapButton3 = QPushButton(self)
        self.MapButton3.setText("测试3")
        self.MapButton3.setAutoFillBackground(False)
        self.MapButton3.clicked.connect(self.test3)
        
        self.MapButton4 = QPushButton(self)
        self.MapButton4.setText("测试4")
        self.MapButton4.setAutoFillBackground(False)
        self.MapButton4.clicked.connect(self.test4)
         
        self.MapButton5 = QPushButton(self)
        self.MapButton5.setText("测试5")
        self.MapButton5.setAutoFillBackground(False)
        self.MapButton5.clicked.connect(self.test5)


        self.vbox = QVBoxLayout()
        self.vbox.addWidget(self.MapButton)
        self.vbox.addWidget(self.MapButton2)
        self.vbox.addWidget(self.MapButton3)
        self.vbox.addWidget(self.MapButton4)
        w.setLayout(self.vbox)
 
        self.statusBar().showMessage("底部信息栏")
        self.resize(300, 500)
        
    def test(self):
        # self.dlg = DlgFixed(self)
        # self.dlg.fixed_coordinates_signal.connect(self.handle_drawing_signal)
        # self.dlg.show()
        self.dlg = DlgMaterialLibrary(self).show()
    def test2(self):
        # pass
        self.dlg = DlgStringedBarLibrary(self).show()
        # self.dlg = DlgParams(self)
        # self.dlg.show()DlgWholeParams
        # self.dlg = DlgFuselageWeb(self).show()
    def test3(self):
        # pass
        self.dlg = DlgLumpedMass(self).show()
        # self.dlg = DlgErrorDetection(self).show()
        # self.dlg.show()
    def test4(self):
        pass
        # self.dlg = DlgAdaptiveAllocation(self).show()
        # self.dlg = DlgFaceSum(self).show()
    def test5(self):
        pass
        # self.dlg = DlgAssemblyPiece(self).show()
    
        # self.dlg = GridModel(self)
        # self.dlg.show()
        
    
 
if __name__ == "__main__":
    app = QApplication(sys.argv)
    mainwindow = MainWindow()
    mainwindow.show()
    sys.exit(app.exec_())